<template>
  <div class='windshop-body'>
    <div class="left">
      <ListUnit :info="formaltData[0]" />
    </div>
    <div class="right">
      <ListUnit v-for="(item, index) in formaltData" v-if="index>0" :key="index" :info="item" />
    </div>
  </div>
</template>
<script>
import ListUnit from '../hotSales/unit.vue'
export default {
  props:['data'],
  components: {ListUnit},
  name: "",
  data() {
    return {
      listData:[
        {
          img:"",
          name:"", 
          money:"",
          count:"",//销量
          codename:"",//代号
        },{},{},{},{},{}
      ]
    };
  },
  computed:{
    formaltData(){
      return this.data||this.listData
    }
  },
  methods: {
      init(){
          _g.apiPost('protalHome/productList.do',{currPageNo:1,pageSize:9,categoryId:1}).then(res=>{
              if(res.status == 0){
                  this.$set(this,'listData',res.data.list)
              }else {
                  _g.toMessage(res)
              }
          })
      }

  },
  created() {
      this.init()
  }
};
</script>
<style lang="scss" scoped>
.windshop-body {
  background-color: #fff;
  height: 400px;
  display: flex;
  box-sizing: border-box;

  .left{
    width: 300px;

    >div{
      border-top: none;
    }
  }
  .right{
    flex: 1;
    display: flex;
    flex-wrap: wrap;

    >div{
      width: 25%;
      height: 200px;
      border: none;
      border-right: 1px solid #efefef;
      border-bottom: 1px solid #efefef
    }
    >div:nth-of-type(n+5){
      
    }
  }
}
</style>